<template>
  <div class="container">
    <div class="divide" />
    <div class="title">
      {{ title }}
      <p-icon v-if="icon" :type="icon" @click="changeIcon" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '基本信息',
    },
    icon: {
      type: String,
      default: '',
    },
  },
  methods: {
    changeIcon() {
      this.$emit('change', this.icon);
    },
  },
};
</script>

<style lang="less" scoped>
.container {
  display: flex;
  align-items: center;
  height: 22px;
  margin-bottom: 20px;
  .title {
    font-weight: 500;
    line-height: 22px;
    font-size: 14px;
    color: #040c2c;
  }
  .divide {
    height: 14px;
    width: 2px;
    margin-right: 10px;
    background: #1740dc;
  }
}
</style>
